// components/voice/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    /* recording: {
      type: Boolean,
      value: false
    } */
  },

  /**
   * 组件的初始数据
   */
  data: {
    waveStaticSrc: 'images/wave@static.png',
    waveDynamicSrc: 'images/wave@dynamic.gif',
    voiceStaticSrc: 'images/voice@static.png',
    voiceDynamicSrc: 'images/voice@dynamic.png',
    recording: false
  },
  /**
   * 组件的方法列表
   */
  methods: {
    onTouchStart: function(event){
      this.setData({
        recording: true
      })
      this.triggerEvent('start', event.detail, {})
    },
    onTouchEnd: function(event){
      this.setData({
        recording: false
      })
      this.triggerEvent('end', event.detail, {})
    }
  }
})
